<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  class Person {
    constructor(name, age) {
      this.name = name;
      this.age = age;
    }
    show() {
      console.log(`我要方法重写`);
    }
  };


  class Son extends Person {
    constructor(name, age) {
      super(name, age);
      this.age = "好人的了";
    }
    show() {
      console.log(`我会覆盖掉父方的，实现重写了。。。`);
    }
  };

  let son = new Son("cz", 20);
  console.log(son.age);
  son.show();
</script>

</html>